package com.jiezhuo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiezhuo.entity.cmeduSchool.JzgNewMenu;
import com.jiezhuo.entity.cmeduSchool.XxdmNewMenu;
import com.jiezhuo.mapper.center.JzgNewMenuMapper;
import com.jiezhuo.mapper.center.XxdmNewMenuMapper;
import com.jiezhuo.service.cmeduSchool.XxdmNewMenuService;
import com.jiezhuo.utils.MeunUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * 服务接口实现
 *
 * @author kancy
 * @description 由 Mybatisplus Code Generator 创建
 * @since 2024-06-06 08:59:27
 */
@Slf4j
@RequiredArgsConstructor
@Service
public class XxdmNewMenuServiceImpl extends ServiceImpl<XxdmNewMenuMapper, XxdmNewMenu> implements XxdmNewMenuService {
    private final XxdmNewMenuMapper xxdmNewMenuMapper;

    @Override
    public ArrayList<JzgNewMenu> getMenuTree(String userId) {
        ArrayList<JzgNewMenu> menuTree = this.getBaseMapper().getMenuTree(userId);

        ArrayList<JzgNewMenu> objects = MeunUtils.getJzgNewMenus(menuTree);

        return objects;
    }
}